<?php
/**
 * Created by PhpStorm.
 * User: FDG296
 * Date: 2017/7/10
 * Time: 15:33
 */
namespace common\models;

use Yii;
use yii\db\ActiveRecord;

class BrandDetail extends ActiveRecord{

    const PC_TYP = 1;
    const WAP_TYP = 2;
    public static function tableName(){
        return '{{%goods_brand_detail}}';
    }

    /**
     * 获取品牌专题
     * @param $brand_id int 品牌id
     * @param $type int  1：PC  2：WAP
     */
    public function getBrandDetail($brand_id,$type){
        $where = ['brand_id'=>$brand_id,'use_flg'=>1,'typ'=>$type];
        $result = $this::find()->where($where)->orderBy('sort asc')->asArray()->all();
        return $result;
    }
}